package main

import (
	"fmt"
	"strings"
)

func main() {
	var str1 string
	fmt.Println("请输入一个值")
	fmt.Scan(&str1)
	var ors string
	ors = (str1[0:2])

	for i := 0; i < len(str1); i++ {
		//fmt.Println(strings.Index("0123456789", string(str1[i])))
		a := strings.Index("0123456789", string(str1[i]))
		if a == -1 {
			fmt.Println("不是整型")
			break
		}
		fmt.Println("是整型")
		break
	}

	if ors == "0b" {
		for i := 2; i < len(str1); i++ {
			//fmt.Println(strings.Index("0123456789", string(str1[i])))
			a := strings.Index("01", string(str1[i]))
			if a == -1 {
				fmt.Println("不是数字类型")
				break
			}
			fmt.Println("是整型")
			break
		}

		if ors == "0o" {
			for i := 2; i < len(str1); i++ {
				//fmt.Println(strings.Index("0123456789", string(str1[i])))
				a := strings.Index("01234567", string(str1[i]))
				if a == -1 {
					fmt.Println("不是数字类型")
					break
				}
				fmt.Println("是整型")
				break
			}
		}
		if ors == "0x" {
			for i := 2; i < len(str1); i++ {
				//fmt.Println(strings.Index("0123456789", string(str1[i])))
				a := strings.Index("0123456789abcdef", string(str1[i]))
				if a == -1 {
					fmt.Println("不是数字类型")
					break
				}
				fmt.Println("是整型")
				break
			}

		}
	}
}